﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace QT.Controls
{
    [ToolboxBitmap(typeof(GlassButton)), ToolboxItem(true), ToolboxItemFilter("System.Windows.Forms"), Description("Raises an event when the user clicks it.")]
    public partial class DataGridView : System.Windows.Forms.DataGridView
    {
        public DataGridView()
        {
            InitializeComponent();
           // AlternatingRowsDefaultCellStyle.BackColor = Color.WhiteSmoke;
            //RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
        }

        //[DefaultValue(typeof(DataGridViewCellStyle), "DataGridViewCellStyle { BackColor=Color [WhiteSmoke] }")]
        //public virtual new DataGridViewCellStyle AlternatingRowsDefaultCellStyle
        //{
        //    get { return base.AlternatingRowsDefaultCellStyle; }
        //    set
        //    {
        //        base.AlternatingRowsDefaultCellStyle = value;
        //    }
        //}

        //[DefaultValue(typeof(DataGridViewRowHeadersWidthSizeMode), "AutoSizeToAllHeaders")]
        //public virtual new DataGridViewRowHeadersWidthSizeMode RowHeadersWidthSizeMode
        //{
        //    get { return base.RowHeadersWidthSizeMode; }
        //    set
        //    {
        //        base.RowHeadersWidthSizeMode = value;
        //    }
        //}

        //protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)
        //{
        //    base.OnRowPostPaint(e);
        //    this.Rows[e.RowIndex].HeaderCell.Value = (e.RowIndex + 1).ToString();
        //    this.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
        //}

        //protected override void OnRowsAdded(DataGridViewRowsAddedEventArgs e)
        //{
        //    base.OnRowsAdded(e);
        //    for (int i = 0; i < e.RowCount; i++)
        //    {
        //        this.Rows[e.RowIndex + i].HeaderCell.Value = (e.RowIndex + i + 1).ToString();
        //        this.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
        //    }
        //    for (int i = e.RowIndex + e.RowCount; i < this.RowCount; i++)
        //    {
        //        this.Rows[i].HeaderCell.Value = (i + 1).ToString();
        //        this.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
        //    }
        //}

        //protected override void OnRowsRemoved(DataGridViewRowsRemovedEventArgs e)
        //{
        //    base.OnRowsRemoved(e);
        //    for (int i = 0; i < e.RowCount; i++)
        //    {
        //        this.Rows[e.RowIndex + i].HeaderCell.Value = (e.RowIndex + i + 1).ToString();
        //        this.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
        //    }
        //    for (int i = e.RowIndex + e.RowCount; i < this.RowCount; i++)
        //    {
        //        this.Rows[i].HeaderCell.Value = (i + 1).ToString();
        //        this.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
        //    }
        //}
    }
}
